<?php

if (! defined ( 'BASEPATH' ))
	exit ( 'No direct script access allowed' );

require (APPPATH . 'libraries/smarty/Smarty.class.php');

class View extends Smarty {
	
	public function __construct() {
		parent::__construct ();
		$CI = & get_instance ();
		
		$this->config_dir = 'smarty/Config_File.class.php'; // 目录变量
		$this->cache_lifetime = 30 * 24 * 3600; //更新周期
		$this->caching = false; //是否使用缓存，项目在调试期间，不建议启用缓存
		$this->template_dir = APPPATH . 'views/'; //设置模板目录
		$this->compile_dir = APPPATH . 'templates_c/'; //设置编译目录
		$this->cache_dir = APPPATH . 'cache/'; //缓存文件夹
		$this->use_sub_dirs = false; //子目录变量（是否在缓存文件夹中生成子目录）
		$this->left_delimiter = '<{';
		$this->right_delimiter = '}>';
		//$this->php_handling=SMARTY_PHP_ALLOW;
		$this->allow_php_tag = true;
		$CI->load->helper ( 'url' );
		$this->assign ( "SITE_URL", site_url () );
		$this->assign ( "BASE_URL", base_url () );
	
	}
	
	public function &getObject() {
		return $this;
	
	}
	
	public function display($html) {
		parent::display ( "$html.html" );
	
	}

}

